#!/bin/bash

NAME=YLWSrvWater

case "$1" in
    start)
        echo -n "Starting ${NAME} "
        python "${NAME}".py &
        echo \n\n
        echo -n "Gracefully create ${NAME} " 
    ;;
    stop)
        kill -9 $(ps -ef | grep ${NAME} | awk '$0 !~/grep/ {print $2}' | tr -s '\n' ' ')
        echo -n "Gracefully shutting down ${NAME}"
        echo \n\n
    ;;
    *)
        echo "Usage: $0 {start|stop}"
        exit 1
    ;;
esac